package it.unisa.unibox.commons;

public class UtilityParser {
	
	public static void main(String args[]){
	}
/**	
	public static void getDipartimento(HttpServletRequest request, HttpServletResponse response) {
		try {

			Element xml_root = new Element("response");
			Element xml_dipartimento;
			Element xml_id;
			Element xml_nome;

			ArrayList<Dipartimento> lista =       //    ??????      UniboxServer.gestioneDipartimenti.getDipartimento();

			for(Dipartimento d: lista){

				xml_dipartimento = new Element("dipartimento");

				xml_id = new Element("id");
				xml_nome = new Element("nome");

				xml_id.setText(""+d.getId());
				xml_nome.setText(d.getNome());

				xml_dipartimento.addContent(xml_id);
				xml_dipartimento.addContent(xml_nome);
			
				xml_root.addContent(xml_dipartimento);

			}

			Document doc = new Document(xml_root);
			XMLOutputter xml_out = new XMLOutputter();
			xml_out.setFormat(Format.getPrettyFormat());
			response.setContentType("text/xml");
			response.setHeader("Cache-Control",	"no-store, no-cache, must-revalidate");      
			PrintWriter out = response.getWriter();                   //Forse questa riga non ci vuole
			xml_out.output(doc, out);

		} catch (Exception e) {
			e.printStackTrace();
		}
	} 	
	
	public static void getAreaScientifica(HttpServletRequest request, HttpServletResponse response) {
		try {

			Element xml_root = new Element("response");
			Element xml_areaScientifica;
			Element xml_id;
			Element xml_nome;
			Element xml_codice;

			ArrayList<AreaScientifica> lista =       //    ??????      UniboxServer.gestioneDipartimenti.getDipartimento();

			for(AreaScientifica a: lista){

				xml_areaScientifica = new Element("areaScientifica");

				xml_id = new Element("id");
				xml_nome = new Element("nome");
				xml_codice = new Element("codice");

				xml_id.setText(""+a.getId());
				xml_nome.setText(a.getNome());
				xml_codice.setText(""+a.getCodice());

				xml_areaScientifica.addContent(xml_id);
				xml_areaScientifica.addContent(xml_nome);
				xml_areaScientifica.addContent(xml_codice);
			
				xml_root.addContent(xml_areaScientifica);

			}

			Document doc = new Document(xml_root);
			XMLOutputter xml_out = new XMLOutputter();
			xml_out.setFormat(Format.getPrettyFormat());
			response.setContentType("text/xml");
			response.setHeader("Cache-Control",	"no-store, no-cache, must-revalidate");      
			PrintWriter out = response.getWriter();                   //Forse questa riga non ci vuole
			xml_out.output(doc, out);

		} catch (Exception e) {
			e.printStackTrace();
		}
	} 	
*/
}
